package com.bookheaven.core.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import entity.base.BaseEntity;

@Entity
@Table(name = "LIKES")
public class Like extends BaseEntity {
	
	private static final long	serialVersionUID	= -9055900697991877349L;
	
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.DETACH)
	@JoinColumn(name = "BOOK_REF", nullable = false)
	private Book				likeBook;
	
	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.DETACH)
	@JoinColumn(name = "USER_REF", nullable = false)
	private User				likeUser;
	
	@Column(name = "LIKE_DATE")
	private Date				likeDate;
	
	public Book getLikeBook() {
		return likeBook;
	}
	
	public void setLikeBook(Book likeBook) {
		this.likeBook = likeBook;
	}
	
	public User getLikeUser() {
		return likeUser;
	}
	
	public void setLikeUser(User likeUser) {
		this.likeUser = likeUser;
	}
	
	public Date getLikeDate() {
		return likeDate;
	}
	
	public void setLikeDate(Date likeDate) {
		this.likeDate = likeDate;
	}
	
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return null;
	}
	
}